home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / CINEMA 4D CE 6 / Libs / gedialog.cox < prev    next >
Text File  |  2000-06-25  |  1KB  |  75 lines

  1. class GeDialog : GeUserDialog
  2. {
  3.         var createlayout;
  4.  
  5.     public:
  6.         GeDialog(pluginid);
  7.  
  8.         Message(msg);
  9.  
  10.         Init();
  11.         CreateLayout();
  12.         Command(id,msg);
  13.         CoreMessage(id,msg);
  14.         Timer(msg);
  15.         AskClose();
  16. }
  17.  
  18. GeDialog::GeDialog(pluginid)
  19. {
  20.     createlayout = FALSE;
  21.     super(pluginid);
  22. }
  23.  
  24. GeDialog::Init()         { return FALSE; }
  25. GeDialog::CreateLayout() { return FALSE; }
  26. GeDialog::Command(id,msg){ return FALSE; }
  27. GeDialog::CoreMessage(id,msg){ return FALSE; }
  28. GeDialog::Timer(msg)     { }
  29. GeDialog::AskClose()     { return FALSE; }
  30.  
  31. GeDialog::Message(msg)
  32. {
  33.     try
  34.     {
  35.         switch (msg->GetId())
  36.         {
  37.             case BFM_INIT:
  38.                 if (createlayout) return TRUE;
  39.                 createlayout = TRUE;
  40.                 return CreateLayout();
  41.  
  42.             case BFM_DESTROY:
  43.                 createlayout = FALSE;
  44.                 break;
  45.  
  46.             case BFM_INITVALUES:
  47.                 return Init();
  48.                 break;
  49.  
  50.             case BFM_CORE_MESSAGE:
  51.                 return CoreMessage(msg->GetInt(BFM_CORE_ID),msg);
  52.                 break;
  53.  
  54.             case BFM_ACTION:
  55.                 return Command(msg->GetInt(BFM_ACTION_ID),msg);
  56.                 break;
  57.  
  58.             case BFM_CHECKCLOSE:
  59.                 return AskClose();
  60.                 break;
  61.  
  62.             case BFM_TIMER_MESSAGE:
  63.                 Timer(msg);
  64.                 return TRUE;
  65.                 break;
  66.         }
  67.         return FALSE;
  68.     }
  69.     catch(ExLastException)
  70.     {
  71.         ExShowLastError();
  72.         return FALSE;
  73.     }
  74. }
  75.